import java.io.*;
import java.nio.file.Files;
import java.nio.file.Paths;

public class IO_study {
    public static void main(String[] args) throws IOException {
        // 创建一个字节输入流管道与源文件接通
        InputStream is = Files.newInputStream(Paths.get("E:\\java_study\\TestFile"));

        // 创建一个字节数组 大小与这个文件大小一致
        File f = new File("E:\\Test\\case\\src\\main\\java\\Data\\TestFile");
        long size = f.length();
        byte[] buffer = new byte[(int) size];

        int len = is.read(buffer);
        System.out.println(new String(buffer));

    }
}
